# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.shortcuts import render,redirect
from django.urls import reverse
from .models import User

# Create your views here.
def home(request):
    users = User.objects.all()
    return render(request,"index.html",{'users':users})

def commit_email(request):
    _name =  request.POST.get('name')
    _email =  request.POST.get('email')
    user = User.objects.create(name = _name,email =_email)
    user.save()
    return redirect(reverse(home))








